package com.bawei.park2211a.mine


import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.bawei.base.mvvm.BaseActivity

import com.bawei.park2211a.adapter.MineApplayAdapter
import com.bawei.park2211a.databinding.ActivityMineApplyBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = "/app/mine/MineApplyActivity")
class MineApplyActivity : BaseActivity<ActivityMineApplyBinding, MineApplyViewModel>() {
   private lateinit var mineApplyAdapter: MineApplayAdapter
    override fun initView() {
        // 创建一个可变列表，用于存储不同的申请实体
        val applyList = mutableListOf<MineApplyEntity>()

        // 创建四个不同类型的申请实体对象
        val carmineApplyEntity = MineApplyEntity()
        val visitMineApplyEntity = MineApplyEntity()
        val repairMineApplyEntity = MineApplyEntity()
        val pollingMineApplyEntity = MineApplyEntity()

        // 为每个申请实体设置标题，标识不同的申请类型
        carmineApplyEntity.applytitle = "车位申请"
        applyList.add(carmineApplyEntity)

        visitMineApplyEntity.applytitle = "来访申请"
        applyList.add(visitMineApplyEntity)

        repairMineApplyEntity.applytitle = "保修申请"
        applyList.add(repairMineApplyEntity)

        pollingMineApplyEntity.applytitle = "巡更申请"
        applyList.add(pollingMineApplyEntity)

        // 创建并配置申请适配器，用于RecyclerView展示申请列表
        mineApplyAdapter = MineApplayAdapter(viewModel.apiService, this)
        mineApplyAdapter.data.addAll(applyList)

        // 设置RecyclerView的适配器和布局管理器
        binding.applyRec.adapter = mineApplyAdapter
        binding.applyRec.layoutManager = LinearLayoutManager(this)
    }

    override fun initData() {

    }
}